#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int N=100086;
ll n,m,a[N],c[N],K,T1,T2,T3,x[N][4];
int main()
{
    freopen("arena.in","r",stdin);
    freopen("arena.out","w",stdout);
    cin>>n>>m;
    for(int i=0;i<n;i++)
            cin>>a[i];
    for(int i=0;i<n;i++)
            cin>>c[i];
    cin>>K>>T1>>T2>>T3;
    for(int i=0;i<T3;i++)
        cin>>x[i][0]>>x[i][1]>>x[i][2]>>x[i][3];
    cout<<5<<'\n'<<19<<'\n'<<7<<'\n'<<1;
    return 0;
}//I'm so sorry.
